<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : rt_100_03K.jsp
    Description : 커뮤니티 사용자 목록
    author EUNGA
    since 2012. 8. 17.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 8. 17.     EUNGA     최초 생성
--%>

<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>현대자동차 CSR &#124; 공모사업 커뮤니티</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<script type="text/javaScript" language="javascript">
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    $("#srchButn").bind("click", moveSearch);    // 검색
    $("#rgstButn").bind("click", moveRgstPage);    // 등록    
    $("#srchTxt").bind("keydown", eventEnter);    // 엔터키 제어
    $("#loginButn").bind("click", loginSubm); // 로그인
    $("#pUpdButn").bind("click", pwMdfy); // 비밀번호 변경
    $("#subForm #mdfyPw").bind("keyup", passCh);    // 비번 확인
    $("#mdfyPwConf").bind("keyup", passCh);    // 비번 확인
});

var clkIdx = "";

/*  
 * 페스워드 확인
 */
function passCh() {
    if ($("#mdfyPw").val() != $("#mdfyPwConf").val()){
        $("#subForm #passImg").html("<img src='/img/usr/common/chgPwd_err04.gif' />");
    }else{
        $("#subForm #passImg").html("<img src='/img/usr/common/chgPwd_err03.gif' />");
    }
}

/*  
 * 페이징
 */
function movePage(num) {
    $("#currentPageNo").val(num);
    $("#mainForm").attr('action','/rt_100_03.do').submit();
}

/*
 * 검색
 */
function moveSearch() {
    if (!isSchrChk($("#srchTxt").val())) {
        alert("검색어에는 특수문자를 입력할 수 없습니다.");
        $("#srchTxt").focus();
        return false;
    }
    
    $("#currentPageNo").val("1");
    $("#mainForm").attr('action','/rt_100_03.do').submit();
}

/*
 * 검색 Text EnterKey 처리
 */
function eventEnter() {
    if (event.key == 13) {
        moveSearch();
    }
}

/*
 * 상세페이지 이동
 */
function moveDtlPage(idx) {
    $("#blbIdx").val(idx);
    $("#mainForm").attr('action','/rt_100_04.do').submit();
}

/*
 * 등록페이지 이동
 */
function moveRgstPage() {
    $("#mainForm").attr('action','/rt_100_05.do').submit();
}

/*
 * 회원로그인
 */
function loginSubm() {
    if (!validateForm($("#loginForm"))) {
        return false;
    }
    
    if (!getIDEmailCheck($("#userId").val())) {
        alert("[아이디] 가 이메일 형식과 맞지 않습니다.");
        $("input[name='userId']").focus();
        return false;
    }
    
    if (clkIdx == "" ) {
        $("#retUrl").val("/rt_100_05.do");
    } else {
        $("#retUrl").val("/rt_100_04.do");
    }
    $("#idx").val(clkIdx);
    
    $("#loginForm").attr('target', 'comIframe');
    $("#loginForm").attr('action','/rt_100_24.do').submit();
}

/*
 * 비밀번호 변경
 */
function pwMdfy() {
    if (!validateForm($("#subForm"))) {
        return false;
    }
    
    if (!getIDEmailCheck($("#subForm #userId").val())) {
        alert("[아이디] 가 이메일 형식과 맞지 않습니다.");
        $("input[name='userId']").focus();
        return false;
    }
    
    if ($("#mdfyPw").val() != $("#mdfyPwConf").val()){
        alert("새 비밀번호가 서로 맞지 않습니다.");
        $("#mdfyPw").focus();
        return false;
    }
    
    $("#subForm").attr('target', 'comIframe');
    $("#subForm").attr('action','/rt_100_26.do').submit();
}


/*
 * 로그인 팝업창 열릴때 해당 인덱스 값을 치환
 */
function idxEqual(idx){
    clkIdx = idx;
}
</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <div class="location">
                        <a href="/ma_100_01.do">홈</a>
                        <a href="/rt_100_01.do">사회공헌</a>
                        <a href="/rt_100_01.do">공모사업</a>
                        <span>공모사업 커뮤니티</span>
                    </div>
                    <h2>공모사업</h2>
                    <ul class="menuTab">
                        <li><h3><a href="/rt_100_01.do">사업소개</a></h3></li>
                        <li class="atv"><h3><a href="/rt_100_02.do">공모사업 커뮤니티</a></h3></li><!-- current menu : add class "atv" -->
                    </ul>
                </div>
                <div id="contetns">
                    <div class="searchArea">
                        <ul class="chooseType">
                            <li class="atv"><span class="typeList"><a href="/rt_100_03.do">리스트형</a></span></li><!-- current menu : add class "atv" -->
                            <li><span class="typeImg"><a href="/rt_100_02.do">이미지형</a></span></li>
                        </ul>
                        <form id="mainForm" name="mainForm" method="post">
                        <div id="search">
                            <fieldset>
                                <input type="hidden" id="currentPageNo" name="currentPageNo" value="${paginationInfo.currentPageNo}" />
                                <input type="hidden" id="blbIdx" name="blbIdx" value="" />
                                <input type="hidden" id="delIdx" name="delIdx" value="" />
                                <input type="hidden" id="listType" name="listType" value="Text" />
                                <fieldset>
                                    <legend class="invisible">Search</legend>
                                    <div class="selectArea">
                                    <select id="srchScn" name="srchScn">
                                        <option value="" <c:if test="${rqInfo.srchScn == '' }"><c:out value="selected" /></c:if>>전체</option>
                                        <option value="titl" <c:if test="${rqInfo.srchScn == 'titl' }"><c:out value="selected" /></c:if>>제목</option>
                                        <option value="sbc" <c:if test="${rqInfo.srchScn == 'sbc' }"><c:out value="selected" /></c:if>>내용</option>
                                    </select>
                                    </div>
                                    <input type="text" id="srchTxt" name="srchTxt" title="검색어입력" value="${rqInfo.srchTxt }" maxlength="10" /><input type="image" class="btnSearch" id="srchButn" name="srchButn" src="/img/mng/btn/btn_search.gif" alt="검색" title="검색" />
                                </fieldset>
                            </fieldset>
                        </div>
                        </form>
                    </div>
                    <table border="1" class="tableList" summary="공모사업 커뮤니티의 번호,제목,이름,기관명,등록일가 기재 되어있는 표">
                        <colgroup>
                            <col width="8%" />
                            <col width="50%" />
                            <col width="12%" />
                            <col width="12%" />
                            <col width="15%" />
                        </colgroup>
                        <thead>
                            <tr>
                                <th>번호</th>
                                <th>제목</th>
                                <th>이름</th>
                                <th>기관명</th>
                                <th>등록일</th>
                            </tr>
                        </thead>
                        <tbody>
                        <c:choose>
                            <c:when test="${resultList != null && !empty resultList }">
                                <c:forEach var="result" items="${resultList }" varStatus="status">
                            <tr>
                                <td class="num">${result.blcNo }</td>
                                <% if (CsrUtil.isLogin(request, "usrSession")) { %>
                                <c:if test="${fn:length(result.titl) > 35 }">
                                <td class="dirLeft"><a href="#" onclick="moveDtlPage('${result.blbIdx }');return false;">${fn:substring(result.titl,0,35) }...</a></td>
                                </c:if>
                                <c:if test="${fn:length(result.titl) <= 35 }">
                                <td class="dirLeft"><a href="#" onclick="moveDtlPage('${result.blbIdx }');return false;">${result.titl }</a></td>
                                </c:if>
                                <% } else { %>
                                <c:if test="${fn:length(result.titl) > 35 }">
                                <td class="dirLeft"><a href="#"  onclick="idxEqual('${result.blbIdx}');" class="layOpen">${fn:substring(result.titl,0,35) }...</a></td>
                                </c:if>
                                <c:if test="${fn:length(result.titl) <= 35 }">
                                <td class="dirLeft"><a href="#"  onclick="idxEqual('${result.blbIdx}');"  class="layOpen">${result.titl }</a></td>
                                </c:if>
                                <% } %>
                                <td>${result.pprrNm }</td>
                                <td>${result.instNm }</td>
                                <td class="num">${result.rgstDt }</td>
                            </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                            <tr>
                                <td colspan="5">등록된 내용이 없습니다.</td>
                            </tr>
                            </c:otherwise>
                        </c:choose>
                        </tbody>
                    </table>
                    <div class="btnArea down">
                    <% if (CsrUtil.isLogin(request, "usrSession")) { %>
                        <span class="reverse"><a href="#" id="rgstButn" name="rgstButn"><img src="/img/usr/btn/btn_register.gif" alt="등록" /></a></span>
                    <% } else { %>
                        <span class="reverse"><a href="#" class="layOpen"><img onclick="idxEqual('${result.blbIdx}');" src="/img/usr/btn/btn_register.gif" alt="등록" /></a></span>
                    <% } %>
                    </div>
                    <div class="pageNate">
                        <able:pagination paginationInfo="${paginationInfo }" type="image" jsFunction="movePage" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /container -->
    
    <!-- layer -->
    <div class="layer">
    <form id="loginForm" name="loginForm" method="post">
        <input type="hidden" id="currentPageNo" name="currentPageNo" value="${paginationInfo.currentPageNo}" />
        <input type="hidden" id="listType" name="listType" value="Image" />
        <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
        <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
        <input type="hidden" id="idx" name="idx" value="" />
        <div class="mask"></div>
        <div class="layPop">
            <p class="btnClose"><button type="button">close</button></p>
            <div class="loginLayer">
                <p class="headTit"><img src="/img/usr/common/layer_tit_login.gif" alt="로그인" /></p>
                <p class="subTit"><img src="/img/usr/common/layer_txt_login1.gif" alt="이곳은 현대자동차 ‘함께 움직이는 세상 공모사업’ 지원기관 담당자들의 커뮤니티 공간입니다. 승인 완료된 회원께서는 아이디와 비밀번호를 입력해 로그인 해주세요." /></p>
                <div class="loginForm">
                    <p><span><img src="/img/usr/common/layer_usr_id.gif" alt="아이디" /></span><input type="text" id="userId" name="userId" value="" title="아이디" nullable="true" maxlength="100" minbyte="8" maxbyte="100" /></p>
                    <p><span><img src="/img/usr/common/layer_usr_pwd.gif" alt="비밀번호" /></span><input type="password" id="userPw" autocomplete="off" name="userPw" value="" title="비밀번호" nullable="true" maxlength="12" minbyte="8" maxbyte="12" chartype="password" /></p>
                    <p class="confirm"><input type="image" id="loginButn" name="loginButn" src="/img/usr/btn/btn_layer_confirm.gif" title="확인" alt="확인" /></p>
                </div>
                <p class="notMsg"><img src="/img/usr/common/layer_txt_login2.gif" alt="비밀번호 분실 시 관리자에게 문의해주시기 바랍니다." /></p>
                <p class="goToJoin">
                    <a href="/rt_100_20.do"><img src="/img/usr/common/layer_txt_login3.gif" alt="회원가입하기" /></a>&nbsp;
                    <a href="javascript:return false;" class="layOpen2"><img src="/img/usr/common/layer_txt_login4.gif" alt="비밀번호 변경하기" /></a>
                </p>
            </div>
        </div>
    </form>
    </div>
    <!-- /layer -->
    
    <!-- layer -->
    <div class="layer2">
        <div class="mask"></div>
        <div class="layPop2">
            <p class="btnClose"><button type="button">close</button></p>
            <div class="chgPwdLayer">
                <p class="headTit"><img src="/img/usr/common/layer_tit_chgPwd.gif" alt="비밀번호 변경하기" /></p>
                <div class="chgPwdForm">
                <form id="subForm" name="subForm" method="post" >
                <input type="hidden" id="returnUrl" name="returnUrl" value="rt_100_03.do" />
                    <dl>
						<!-- cidow_130410-->
                        <dt><label for="userNm"><img src="/img/usr/common/chgPwd_item01.gif" alt="이름" /></label></dt>
                        <dd>
                            <input type="text" id="userNm" name="userNm" />
                        </dd>
						<dt><label for="instNm">
						<!-- cidow_130410-->
						<img src="/img/usr/common/chgPwd_item02.gif" id="instNm" alt="기관명" />
						<!--//cidow_130410-->
						</label></dt>
						<dd>
                            <input type="text" name="instNm" alt="기관명" />
                        </dd>
                        <dt><label for="userId"><img src="/img/usr/common/chgPwd_item03.gif" alt="메일주소(아이디)" /></label></dt>
                        <dd>
                            <input type="text" id="userId" name="userId" nullable="true" />
                            <span><img src="/img/usr/common/chgPwd_err01.gif" alt="*회원가입 시 입력한 메일주소를 입력해주세요." /></span><!-- err msg -->
                        </dd>
                        <dt><label for="userPw"><img src="/img/usr/common/chgPwd_item04.gif" alt="기존 비밀번호" /></label></dt>
                        <dd>
                            <input type="password" title="기존 비밀번호" id="userPw" name="userPw" maxlength="12" nullable="true" chartype="password"/>
                        </dd>
                        <dt><label for="mdfyPw"><img src="/img/usr/common/chgPwd_item05.gif"  alt="비밀번호" /></label></dt>
                        <dd>
                            <input type="password" title="새 비밀번호" id="mdfyPw" name="mdfyPw" maxlength="12"/>
                            <span><img src="/img/usr/common/chgPwd_err02.gif" alt="*영문 대/소문자와 숫자 조합으로 10~12자로 설정해주세요." /></span><!-- err msg -->
                        </dd>
                        <dt><label for="mdfyPwConf"><img src="/img/usr/common/chgPwd_item06.gif" alt="비밀번호 확인" /></label></dt>
                        <dd>
                            <input type="password" id="mdfyPwConf" name="mdfyPwConf"/>
                            <span id="passImg" name="id="passImg"" ></span>
                        </dd>
					 <!-- // cidow_130410-->
					 <!-- cidow_130410 --> <!-- // cidow_130410-->
                    </dl>
                </div>
                <div class="chgPwdBtn">
                    <a href="#" id="pUpdButn"><img src="/img/usr/btn/btn_layer_confirm_2.gif" id="" alt="확인" /></a>
                    <a href="#" class="modalClose"><img src="/img/usr/btn/btn_layer_cancel.gif" alt="취소" /></a>
                </div>
            </form>
            </div>
        </div>
    </div>
    <!-- /layer -->

    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>


